# cmake_minimum_required(VERSION 3.5)
# project(RTC)

# add_definitions(-std=c++11)
# add_definitions(-DWEBRTC_POSIX)
# add_definitions(-DWEBRTC_LINUX)
# # -fno-rtti 禁止运行时类型信息 不加会出现某些包含纯虚函数的类 undefine reference 暂时也没搞懂原因
# add_definitions(-D -fno-rtti)

# file(GLOB_RECURSE ali_LIB "/home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/lib/*.a")

# include_directories(
#     /home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/include/webrtc
#     /home/yqw/temp/webrtc_all/webrtc-checkout_render/src/third_party/abseil-cpp/
#     )
# # link_directories()

# add_executable( 
#     main.cpp 
#     srsconductor.cpp
# )
# target_link_libraries(${ali_LIB} pthread)




# cmake_minimum_required(VERSION 3.5)
# project(webRTC)

# add_definitions(-std=c++11)
# add_definitions(-DWEBRTC_POSIX)
# add_definitions(-DWEBRTC_LINUX)
# # -fno-rtti 禁止运行时类型信息 不加会出现某些包含纯虚函数的类 undefine reference 暂时也没搞懂原因
# add_definitions(-D -fno-rtti)

# include_directories(/home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/include/webrtc
# /home/yqw/temp/webrtc_all/webrtc-checkout_render/src/third_party/abseil-cpp/)
link_directories(${CMAKE_SOURCE_DIR}/thirdparty/lib/ ${CMAKE_SOURCE_DIR}/lib/)
# /home/yqw/temp/OTO/srsclient/thirdparty/lib/

# set(SOURCE_FILES main.cpp
# srsconductor.cpp)
# add_executable(${SOURCE_FILES})
# target_link_libraries(/home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/lib/libwebrtc.a pthread)




cmake_minimum_required(VERSION 2.8.3)

project(srsclient)
add_compile_options(-std=c++17)
# add_compile_options(-std=c++14)
# add_definitions(-std=c++11)
add_definitions(-DWEBRTC_POSIX)
add_definitions(-DWEBRTC_LINUX)
# add_definitions(-D_GLIBCXX_USE_CXX11ABI=0)
# add_definitions(-D -fno-rtti)

# find_package(COMPONENTS
# )

# catkin_package()

# file(GLOB_RECURSE protobuf3.7.1_LIB "thirdparty/protobuf/lib/*.a")


include_directories(
    # ./include/webrtc
    # ./include/webrtc/third_party/abseil-cpp
    # ./include/webrtc/third_party/jsoncpp/source/include
    # ./include/webrtc/third_party/libyuv/include/
    # ./thirdparty/include/

    # /home/yqw/temp/webrtc_all/webrtc-checkout_render/src
    # /home/yqw/temp/webrtc_all/webrtc-checkout_render/src/third_party/abseil-cpp
    # /home/yqw/temp/webrtc_all/webrtc-checkout_render/src/third_party/jsoncpp/source/include
    # /home/yqw/temp/webrtc_all/webrtc-checkout_render/src/third_party/libyuv/include/
    ./thirdparty/user_include/
    ./thirdparty/include/
    ./video/
    ./yangplayer/
    ./thirdparty/yangplayer/
    ./include/
    ./include/libmetartc7-include/src
    ./include/libmetartccore7-include/src
    ./
)

file(GLOB_RECURSE SOURCES "./*.cpp")
list(FILTER SOURCES EXCLUDE REGEX "/build/.*")
list(FILTER SOURCES EXCLUDE REGEX "./thirdparty/src")

# file(GLOB SOURCES_VIDEO "video/*.cpp")
# file(GLOB SOURCES_VIDEO "yangplayer/*.cpp")


add_executable(${PROJECT_NAME}
    # D_main.cpp
    ${SOURCES}
    # ${SOURCES_VIDEO}
)

#paho-mqttpp3 paho-mqtt3cs
target_link_libraries(
    ${PROJECT_NAME}
    # ${catkin_LIBRARIES}
    # ${PROJECT_NAME}_lib
    # pthread
    # libwebrtc.a
    # # webrtc

    # curl
    # m
    # dl
    # X11
    # glib-2.0
    # libshm.so
    # shm
    metartc7  metartccore7 yuv speexdsp opus yangh264decoder usrsctp pthread  dl ssl2 crypto2 srtp2 asound libopenh264.a
)

install(TARGETS ${PROJECT_NAME}
    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY data/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/data
)


